package com.huyun.web.FutureTest;

import java.awt.*;
import java.util.Date;

/**
 * @program:
 * @description:
 * @author: hyq
 * @create: 2021-12-30 16:35
 */
public class WaterMarkTask implements Runnable{

    private static final Font font = new Font("微软雅黑", Font.BOLD, 100);
    private static final String srcImgPath="E:\\zs.png"; //源图片地址
    private static final Color color=new Color(0,0,0,0256);
    //设置坐标
    private static final int[][] position = {{870,860},{1600, 860},{1910, 860},{2400, 860},{2700, 860}
            ,{510,1160},{900,1160},{1150,1160},{1700,1160},{2200,1160},{2500,1160}
            ,{1850,2120},{2380,2120},{2700,2120},{850,2110}};

    private int taskNum;

    public WaterMarkTask(int num) {
        this.taskNum = num;
    }
    @Override
    public void run() {

        try {
            String tarImgPath="E:\\zs\\"+new Date().getTime()+".png";
            String cont = "李星星,女,1984,3,8," +
                    "2020,07,10,2021,05,25," +
                    "2021,2,10,202101012170";
            String[] waterMarkContent = cont.split(",");
            WaterMarkUtils.addWaterMark(srcImgPath,tarImgPath,waterMarkContent,position,color,font);
            System.out.println(Thread.currentThread().getName());
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
